<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FolderSize.WPF">


   <Style TargetType="{x:Type local:BubbleContentControl}">
      <Setter Property="MinWidth" Value="100"/>
      <Setter Property="MinHeight" Value="100"/>
      <Setter Property="ContentRectMargin" Value="4,4,4,0"/>
      <Setter Property="ClipToBounds" Value="False"/>
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:BubbleContentControl}">
               <Grid>
                  <Grid.Effect>
                     <DropShadowEffect
                           BlurRadius="16"
                           Opacity="0.5"
                           ShadowDepth="10"
                           />
                  </Grid.Effect>
                  <Grid.RowDefinitions>
                     <RowDefinition Height="*"/>
                     <RowDefinition Height="40"/>
                  </Grid.RowDefinitions>
                  <Path Grid.RowSpan="2" Stroke="White" StrokeThickness="4" Stretch="None" ClipToBounds="False" >
                     <Path.Fill>
                        <LinearGradientBrush 
                           StartPoint="0,0" 
                           EndPoint="0,1" 
                           >
                           <GradientStop Color="#FF7BAAFF" Offset="0.0"/>
                           <GradientStop Color="#FF71A1FB" Offset="0.1"/>
                           <GradientStop Color="#FF4F82F0" Offset="0.4"/>
                           <GradientStop Color="#FF38447D" Offset="1.0"/>
                        </LinearGradientBrush>
                     </Path.Fill>
                     <Path.Data>
                        <CombinedGeometry GeometryCombineMode="Xor">
                           <CombinedGeometry.Geometry1>
                              <RectangleGeometry
                                 RadiusX="20" 
                                 RadiusY="20" 
                                 Rect="{Binding RelativeSource={RelativeSource TemplatedParent},Mode=OneWay,Path=ContentRect}" 
                                 />
                           </CombinedGeometry.Geometry1>
                           <CombinedGeometry.Geometry2>
                              <PathGeometry Figures="M30,0 20,-36 60,0">
                                 <PathGeometry.Transform>
                                    <TransformGroup>
                                       <ScaleTransform ScaleX="-1" ScaleY="-1"/>
                                       <TranslateTransform X="{Binding ElementName=ContentGrid,Path=ActualWidth}" Y="{Binding ElementName=ContentGrid,Path=ActualHeight}"/>
                                    </TransformGroup>
                                 </PathGeometry.Transform>
                              </PathGeometry>
                           </CombinedGeometry.Geometry2>
                        </CombinedGeometry>
                     </Path.Data>
                  </Path>
                  <Grid x:Name="ContentGrid">
                     <ContentPresenter Margin="20" x:Name="Content"/>
                  </Grid>
               </Grid>

            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>
</ResourceDictionary>
